import java.util.ArrayList;

/**
 * 
 */

/**
 * @author home
 *
 */
public class Node {
	ArrayList <Double> xList;
	ArrayList <Double> yList;
	double [][] arrayOfNodes;
	public Node(){
		xList = new ArrayList <Double>();
		yList = new ArrayList <Double>();
		
		
	}
	
	public double[][] generateNodeArray(Node node){
		
		int lengthOfNode = node.xList.size();
		node.arrayOfNodes = new double [lengthOfNode][lengthOfNode];
		
		
		for(int i = 0; i< lengthOfNode; i++){
			arrayOfNodes[i][i] = -1.0;
			for(int j = i +1; j<lengthOfNode; j++){
				node.arrayOfNodes[i][j] =node.arrayOfNodes[j][i]=getDistance(node.xList.get(i),node.yList.get(i),node.xList.get(j),node.yList.get(j));
			}
		}
			
		 return arrayOfNodes;
		
	}

	private void print(double[][] arrayOfNodes) {
		for(int i = 0; i< arrayOfNodes.length; i++){
			for(int j = 0; j< arrayOfNodes.length; j++){
				System.out.print(arrayOfNodes[i][j]+" ");
			}
			System.out.println();
		}
	}

	private double getDistance(double x, double y,
			double x1, double y1) {
	
		return Math.sqrt(((x-x1) * (x-x1)) + ((y-y1) * (y-y1)));
	}
	
	

}
